import Commons.Replicazione.RMDiscovery;
import Discovery.WorkerDiscovery;
import java.io.IOException;
import java.net.UnknownHostException;
import javax.xml.stream.XMLStreamException;

/**	Questa classe contiene il main() che crea l'istanza del Discovery
 *
 * @author Team5
 */
public class MainDiscovery {
      private static WorkerDiscovery wd;
      private static RMDiscovery rd;
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws UnknownHostException, XMLStreamException, InterruptedException, IOException {
     try{
       System.out.println("MainDIscovery: start");
       System.out.println("MainDiscovery: creo un istanza del WorkerDiscovery");
       rd=new RMDiscovery();
       wd=new WorkerDiscovery(rd);
        }catch(Exception ex){
        System.out.println("RESTART WORKER DISCOVERY");
        WorkerDiscovery wdrecovery=new WorkerDiscovery(rd,rd.recuperaStato());
        }
     }

}
